package org.lmind.scale.study

import scala.reflect.BeanProperty

class HelloWorldClass {
  
  def hello() = {
    println("hello world")
  }
  
  @BeanProperty var x:Int = 0
  
}

object HelloWorld {

  def fn1() = 1 + 234
  def fn2() = {
    1 + 2
  }
  def fn3() = {
    println(123)
    1 + 2
  }
  def fn4() = {
    1 + 2
    println(123)
  }
  def fn5(): Int = {
    return 1
  }
  
  def fn6(a:Int) = {
    a match {
      case 1 => a + 1
      case 2 => a + 2
      case 3 => a + 3
      case _ => a
    }
  }
  
  def main(args: Array[String]) {
    var h = new HelloWorldClass();
    h.hello();
    println("fn1 = " + fn1())
    println("fn2 = " + fn2())
    println("fn3 = " + fn2())
    println("fn4 = " + fn2())
    println("fn5 = " + fn2())
    
    println("fn6(1) = " + fn6(1))
    println("fn6(2) = " + fn6(2))
    println("fn6(3) = " + fn6(3))
    println("fn6(4) = " + fn6(4))
    println("fn6(5) = " + fn6(5))
  }
}